#tf-idf-tdf编码的实现
import pandas as pd
import numpy as np
dic_word=[]#所有文档组成语料库，语料库中的所有文档
file_word=[]#文档中的所有语料
#读取字典
with open('./dic.txt', 'r', encoding='utf-8') as f:
    str = f.read()
    file_word = str.split('\n')
    file_word = [word.split() for word in file_word if len(word) > 0]
dic_word.append(file_word)